﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WorkTrendsEdit.aspx.cs"
    Inherits="SXT.Party.PartyAdmin.Module.WorkTrends.WorkTrendsEdit" %>

<%@ Register Assembly="SXT.Web.Controls.V2" Namespace="SXT.Web.Controls" TagPrefix="SXT" %>
<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <base target="_self" runat="server" id="baseTarget" visible="false" />
    <script src="../../../../../Resource/js/uploadify/swfobject.js" type="text/javascript"></script>
    <script src="../../../../../Resource/js/uploadify/jquery.uploadify.min.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        $(function () {
            if ($("#hdFileID").val() != "")
            { $("#deleteFile").show(); }
            else {
                $("#deleteFile").hide();
            }

            $("#fuFile").uploadify({
                'uploader': '../../../../../Resource/themes/default/images/uploadify/uploadify.swf',
                'script': '../../../Shared/Files/FileUpload.aspx',
                'cancelImg': '../../../../../Resource/themes/default/images/uploadify/button-cancel.png',
                'queueID': 'fileQueue',
                'auto': true,
                'multi': false,
                'wmode': 'transparent',
                'buttonImg': '../../../../../Resource/themes/default/images/uploadify/button-upload.png',
                'width': 40,
                'height': 18,
                'onSelect': function (e, queueId, fileObj) {
                    $(".div_single_progress > div").width("0px");
                    $(".div_single_progress > label").html(fileObj.name);
                    $("#hdFullName").val("");
                    $("#hdFileID").val("");
                },
                'onComplete': function (event, queueID, fileObj, response, data) {

                    if (response == "FileExtensionsError") {
                        alert("不允许上传此类型文件，请重新选择文件上传！");
                        return;
                    }
                    $("#hdFileName").val(fileObj.name); //保存存储名
                    $("#hdFileID").val(response); //保存存储路径
                    window.parent.$('#closeQuestion').val(true);

                    $.ajax({
                        type: "POST",
                        contentType: "application/json",
                        url: "WorkTrendsEdit.aspx/LoadImageUrl",
                        data: "{id:'" + response + "'}",
                        dataType: "json",
                        success: function (msg) {
                            var json = eval(msg);
                            $("#lnkFileName").attr("href", json.d);
                        }, error: function (XMLHttpRequest) {
                            alert(XMLHttpRequest.status);
                        }
                    });
                    $("#deleteFile").show();
                    alert("上传成功！");
                },
                'onProgress': function (event, queueId, fileObj, data) {
                    $(".div_single_progress > div").width(data.percentage + "%");
                },
                'onError': function (event, queueId, fileObj, errorObj) {
                    alert("上传失败！");
                }
            });
            $("#deleteFile").click(function () {
                $("#hdFileID").val("");
                $("#hdFullName").val("");
                $(".div_single_progress > div").width(0);
                $("#lblFileName").html("");
            });


        });
    </script>
</head>
<body>
    <form id="frmNoticeEdit" runat="server">
        <div class="edit-main">
            <!--表单内容-->
            <div class="edit-content" style="position:relative">
                <table border="0" cellpadding="2" cellspacing="2" class="edit-content-table">
                    <tr>
                        <td align="right" style="width: 10%">标题：
                        </td>
                        <td align="left" style="width: 40%">
                            <SXT:TextBoxEx ID="txtTitle" runat="server" Width="92%" IsRequired="true" IsRequiredMessage="请填写标题"></SXT:TextBoxEx>
                        </td>
                        <td align="right" style="width: 10%">所属组织：
                        </td>
                        <td align="left" style="width: 40%">
                            <SXT:Picker ID="ppBranch" runat="server" IsRequired="true" IsRequiredMessage="请选择所属组织"
                                PickerPage="../../../Shared/Picker/OrgBranchPicker.aspx" Width="92%">
                                <DialogOptionSetting Width="230px" Height="325px" Title="党组织选择器" ParentContainerID="editDialog" />
                            </SXT:Picker>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">展示图片：
                        </td>
                        <td align="left">
                            <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                <tr>
                                    <td>
                                        <div id="fileQueue" style="display: none">
                                        </div>
                                        <div class='div_single_progress'>
                                            <div>
                                            </div>
                                            <label id="lbFileName" runat="server">
                                            </label>
                                        </div>
                                        <asp:HiddenField ID="hdFileName" runat="server" />
                                        <asp:HiddenField ID="hdFileID" runat="server" />
                                    </td>
                                    <td valign="middle" style="width: 80px; padding-left: 5px;">
                                        <asp:FileUpload ID="fuFile" runat="server" Style="display: none; width: 45px; vertical-align: middle;" />
                                        <a href="" target="_blank" id="lnkFileName" runat="server" style="vertical-align: middle;">查看</a>
                                        <a href="" id="deleteFile" runat="server" style="display: none">删除</a>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td colspan="2" align="left">
                            <SXT:CheckBoxEx ID="cbIsTop" runat="server" Text="文字置顶" />
                            <SXT:CheckBoxEx ID="cbSuperTop" runat="server" Text="图片固顶" />
                            <SXT:CheckBoxEx ID="cbIsFirst" runat="server" Text="图片置顶" />
                            <SXT:CheckBoxEx ID="cbShowInHomePage" runat="server" Text="首页" Checked="true" Visible="false" />
                            <SXT:CheckBoxEx ID="cbStatus" runat="server" Text="已发布" />
                        </td>
                    </tr>
                    <tr>
                        <td align="right" style="width: 10%">活动时间：
                        </td>
                        <td align="left" style="width: 40%">
                            <SXT:DateTimeEx ID="dtActivityTime" runat="server" Width="92%" IsRequired="true"
                                DateFormat="yyyy-MM-dd" IsRequiredMessage="请选择活动时间" />
                        </td>
                        <td align="left" colspan="2">
                            <SXT:CheckBoxListEx runat="server" ID="cblPublishRange" RepeatDirection="Horizontal">
                                <asp:ListItem Text="上级组织首页(点“发布”时有效)" Value="1"></asp:ListItem>
                            </SXT:CheckBoxListEx>
                        </td>
                    </tr>
                    <tr>
                        <td align="right" style="width: 10%">所属专题：</td>
                        <td align="left" style="width: 40%">
                            <SXT:DropDownListEx ID="ddlThematic" runat="server" Width="90%">
                            </SXT:DropDownListEx></td>
                        <td align="left" colspan="2">&nbsp;</td>
                    </tr>
                    <tr>
                        <td align="left" colspan="4">
                            <CKEditor:CKEditorControl ID="ckContent" runat="server" Width="100%" Height="300px"
                                ResizeEnabled="false" BasePath="../../../Shared/Basic/CKEditor/" FilebrowserUploadUrl="../../../Shared/Files/FileUpload.aspx">
                            </CKEditor:CKEditorControl>
                        </td>
                    </tr>
                    <tr runat="server" id="trPush" visible="false">
                        <td  align="right">信息推送：</td>
                        <td colspan="3">
                           <SXT:CheckBoxListEx ID="checkPush" runat="server">

                           </SXT:CheckBoxListEx>
                        </td>
                    </tr>
                </table>
            </div>
            <!--按钮栏-->
            <div class="edit-buttonbar">
                <table border="0" cellpadding="0" cellspacing="0" class="edit-buttonbar-table">
                    <tr>
                        <td>
                            <SXT:ButtonEx ID="btnAgree" runat="server" ControlSign="Save" CssName="agree" Visible="false"
                                OnClick="btnAgree_Click" />
                        </td>
                        <td>
                            <SXT:ButtonEx ID="btnDisagree" runat="server" ControlSign="Save" CssName="Disagree"
                                Visible="false" OnClick="btnDisagree_Click" />
                        </td>
                        <td>
                            <SXT:ButtonEx ID="btnEnsure" runat="server" ControlSign="Save" CssName="Release"
                                OnClick="btnEnsure_Click" />
                        </td>
                        <td>
                            <SXT:ButtonEx ID="btnSaveClose" runat="server" ControlSign="Save" CssName="saveclose"
                                OnClick="btnSaveAndClose_Click" />
                        </td>
                        <td>
                            <SXT:ButtonEx ID="btnSave" runat="server" ControlSign="SaveAndPreview" CssName="saveAndPreview"
                                OnClick="btnSave_Click" />
                        </td>
                        <td>
                            <SXT:ButtonEx ID="btnClose" runat="server" CssName="close" ClientScript="" />
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </form>
</body>
</html>
